Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Scripting Additions Guide /
Chapter 2 - Scripting Addition Commands / Command Definitions
/


Start Log

The Start Log command turns on logging in the Script Editor's Event Log window, which is shown in Figure 2-7.

If the checkboxes Show Events and Show Event Results are both selected, as shown in Figure 2-7, subsequent commands sent by the Script Editor and the results returned for each event are displayed in this window. You can choose to display either the events or their results by selecting just one of the checkboxes. You can also save a copy of the text in the Event Log window by choosing Save As from the File menu.

Unlike most other scripting additions, the Start Log command is built into
the AppleScript extension. It doesn't have a separate file in the Scripting Additions folder.

Figure 2-7 The Script Editor's Event Log window

SYNTAX
start log
RESULT
None

EXAMPLE
The example that follows demonstrates how to start logging and demonstrates how logging works. To see descriptions in AppleScript of the logged events generated by this example, open the Event Log window in the Script Editor application by choosing Open Event Log from the Controls menu. Make sure that both the Show Events and Show Event Results checkboxes are selected, as shown in Figure 2-7.

start log
display dialog "Hello"
After you run the preceding script, the record of the events sent and the result returned appear in the Event Log window. Because the Display Dialog command in this script is not enclosed in a Tell statement, Script Editor sends the command to the current application--that is, to itself. The event log for
the script shows both this implicit Tell statement and the result returned
by the Display Dialog command.

ERRORS
Error
number
Error message
-50Parameter error.
-108Out of memory.
-1700Can't make some data into the expected type.
-1701Some parameter is missing for <commandName>.
-1704Some parameter was invalid.
-1705Operation involving a list item failed.
-1708<reference> doesn't understand the <commandName> message.
-1718Reply has not yet arrived.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
18 DEC 1996